package com.free.logic.dao;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

public interface DAO <T>{
	Serializable save(T entity);

	List<T> query(String hql, int offset, int pageSize);

	int queryResultCount(String queryHql);

	void saveOrUpdate(T entity);

	void saveOrUpdate(Collection<T> entities);

	void delete(T entity);

	T queryByPk(Class<T> entityClass, Object pk);

	void deleteByPk(Class<T> entityClass, Object pk);
}
